package com.yidu.mapper;

import com.yidu.entity.WorkUser;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * user的dao层
 * @author 任俊杰
 * @version 1.0
 * @date 2022/8/21
 */
@Repository
@Mapper
public interface WorkUserMapper {
    // page  页码
    // limit  每页显示的条数
    //查询
    @Select("select * from workUser where 1=1 ${strWhere} limit #{page},#{limit}")
    public List<WorkUser>query(Map map);

    //分页查行数 模糊查询后的行数 根据条件
    @Select("select count(*) from workUser where 1=1 ${strWhere}")
    public int queryCount(Map map);

    //新增
    @Insert("insert into workUser(username,usersex,userage,useraddress) values(#{username},#{usersex},#{userage},#{useraddress})")
    public int addUser(WorkUser workUser);

    //修改
    @Update("update workUser set username=#{username},usersex=#{usersex},userage=#{userage},useraddress=#{useraddress} where userid=#{userid}")
    public int updateUser(WorkUser workUser);

    //删除
   // @Delete("delete from workUser where userid=#{userid}")
    //@Delete("delete from workUser where userid in (userid)")
    public int deleteUser(List userid);



   // @Delete("delete from workUser where userid=#{userid}")
   // public int deleteUser1(Integer userid);


}
